package phoenix.web.test_suites.benaughty.common;

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import phoenix.core.base.TestSuiteBase;
import phoenix.core.data_models.TestUserDataModel;
import phoenix.core.data_models.UserProfileDataModel;
import phoenix.web.test_objects.*;

public class MessengerTS extends TestSuiteBase

{
	private final RegistrationTests registrationTests = new RegistrationTests(phoenix);
	private final BackendTests backendTests = new BackendTests(phoenix);
	private final UserPageTests userPageTests = new UserPageTests(phoenix);
	private final FunnelTests funnelTests = new FunnelTests(phoenix);
	private final MessengerTests messengerTests = new MessengerTests(phoenix);

	@DataProvider
	public Object[][] userPageDataMale()
	{
		return userPageTests.dataProviders.messengerDataMale();
	}

	@DataProvider
	public Object[][] messengerOpenData()
	{
		return userPageTests.dataProviders.messengerOpenData();
	}

	@DataProvider
	public Object[][] messageFromUserProfile()
	{
		return userPageTests.dataProviders.messageFromUserProfile();
	}

	@DataProvider
	public Object[][] messengerDeliveryStatus()
	{
		return userPageTests.dataProviders.messengerDeliveryStatus();
	}

	@DataProvider
	public Object[][] userDataProvider()
	{
		return messengerTests.dataProviders.registrationDataMale();
	}

	@Test(dataProvider = "userDataProvider", groups = { "registration" }, priority = 1, enabled = true)
	public void registrationTestMale(String p_userGender, String p_userEmail, String p_userPassword, String p_userBirthDay,
			String p_userBirthMonth, String p_userBirthYear, String p_screenName, UserProfileDataModel.LookingFor p_lookingForParams,
			UserProfileDataModel.AboutMe p_aboutMeParams)
	{
		registrationTests.registrationTest(p_userGender, p_userEmail, p_userPassword, p_userBirthDay, p_userBirthMonth, p_userBirthYear);
		backendTests.getUserDataTest(testUser().getEmail());
		funnelTests.confirmationTest();
		funnelTests.funnelTest(p_screenName, p_lookingForParams, p_aboutMeParams);
	}

	@Test(groups = { "interaction" }, priority = 2, dataProvider = "messengerOpenData", enabled = true)
	public void messageFromSearchTest(TestUserDataModel[] p_userRecipient)
	{
		messengerTests.messageFromSearch(p_userRecipient);
	}

	@Test(groups = { "interaction" }, dataProvider = "messengerDeliveryStatus", priority = 3, enabled = true)
	public void messengerDeliveryStatusTest(TestUserDataModel p_user)
	{
		messengerTests.messageDeliveryStatusTest(p_user);
	}

	@Test(groups = { "interaction" }, dataProvider = "messengerOpenData", priority = 4, enabled = true)
	public void messengerOpenTest(TestUserDataModel[] p_userRecipient)
	{
		messengerTests.messengerOpenTest(p_userRecipient);
	}

	@Test(groups = { "interaction" }, priority = 5, enabled = true)
	public void messengerModesTest()
	{
		messengerTests.messengerModesTest();
	}

}
